import Http from '@/http';

export function saveApi(params:any) {
    return params.id ? Http.put('banner/update/' + params.id, params) : Http.post('banner/add', params)
}

export function pageApi(params:any) {
    return Http.post('banner/page', params)
}

export function deleteApi(id) {
    return Http.delete('banner/delete/' + id)
}

export function uploadApi(file:File) {
    const formData = new FormData()
    formData.append('pic', file)
    return Http.post('banner/upload', formData)
}